<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
	<aside class="main-sidebar" th:fragment="main-sidebar(userSession,number)">
		<section class="sidebar">
			<div class="user-panel">
				<div class="pull-left image">
					<img src="img/user2-160x160.jpg" class="img-circle" alt="User Image">
				</div>
				<div class="pull-left info">
					<p>文浩然</p>
					<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
				</div>
			</div>
			<!--@formatter:off -->
			<ul class="sidebar-menu" data-widget="tree">
				<li class="header">系统菜单</li>
				<li th:if="${#strings.toString(menu.type)} eq 'MENU'" th:each="menu : ${userSession.menus}" 
					th:class="${#strings.equals(number,menu.number)} ? 'treeview active':(${#strings.startsWith(number, menu.number)} ? 'active treeview menu-open':'treeview')">
					<a th:href="@{${menu.children.size() gt 0 ? 'javascript:;': menu.uri}}"> 
						<i th:class="${menu.icon}"></i> 
						<span th:text="${menu.name}"></span> 
						<i th:if="${menu.children.size() gt 0}" class="fa fa-angle-left pull-right"></i>
					</a>
					<ul th:if="${menu.children.size() gt 0}" class="treeview-menu">
						<li th:if="${#strings.toString(smenu.type)} eq 'MENU'" th:each="smenu : ${menu.children}"  	
						    th:class="${#strings.equals(number,smenu.number)} ? 'active':(${#strings.startsWith(number, smenu.number)} ? 'treeview menu-open':'')">
							<a th:href="@{${smenu.uri}}" th:attr="data-breadcrumb=${menu.name+':'+smenu.name}"> 
								<i th:class="${smenu.icon}"></i>
								<span th:text="${smenu.name}"></span>
							</a>
							<ul th:if="${smenu.children.size() gt 0}" class="treeview-menu">
								<li th:if="${#strings.toString(three.type)} eq 'MENU'" th:each="three,smenuStat:${smenu.children}"  
								    th:class="${#strings.equals(number,three.number)} ? 'active':(${#strings.startsWith(number, three.number)} ? 'treeview menu-open':'')">
									<a th:href="@{${three.uri}}" th:attr="data-breadcrumb=${menu.name+':'+smenu.name+':'+three.name}"> 
										<i th:class="${three.icon}"></i> 
										<span th:text="${three.name}"></span>
									</a>
								</li>
							</ul>
						</li>
					</ul>
				</li>
			</ul>
			<!--@formatter:on -->
			<!-- /.sidebar-menu -->
		</section>
		<!-- /.sidebar -->
	</aside>
</body>
</html>